import * as actionTypes from './actionTypes'
import { fromJs } from 'immutable'
const defaultState = fromJs({
    focused: false
})
export default (state = defaultState, action) => {
    if(action.type === actionTypes.INPUT_FOCUS){
        // const newState = JSON.parse(JSON.stringify(state));
        // newState.focused = true
        // return newState
        return state.set({
            focused:true
        })
    }
    if(action.type === actionTypes.INPUT_BLUR){
        return state.set({
            focused:false
        })
    }
    return state
}